/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * StartupCompanyManager2012ProjectManager.java
 *
 * Created on 03.12.2011, 18:43:08
 */
package startupcompanymanager2012;

import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 *
 * @author Matthäus
 */
public class StartupCompanyManager2012ProjectManager extends javax.swing.JFrame {

    /** Creates new form StartupCompanyManager2012ProjectManager */
    public StartupCompanyManager2012ProjectManager() {
        initComponents();
                
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        projectManagerPanel = new javax.swing.JPanel();
        gameDevButton = new javax.swing.JButton();
        sideProjButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);

        projectManagerPanel.setName("projectManagerPanel"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(startupcompanymanager2012.StartupCompanyManager2012App.class).getContext().getResourceMap(StartupCompanyManager2012ProjectManager.class);
        gameDevButton.setIcon(resourceMap.getIcon("gameDevButton.icon")); // NOI18N
        gameDevButton.setText(resourceMap.getString("gameDevButton.text")); // NOI18N
        gameDevButton.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder(""), resourceMap.getString("gameDevButton.border.title"), javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, resourceMap.getFont("gameDevButton.border.titleFont"))); // NOI18N
        gameDevButton.setName("gameDevButton"); // NOI18N
        gameDevButton.setPreferredSize(new java.awt.Dimension(140, 140));
        gameDevButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                codeGame(evt);
            }
        });

        sideProjButton.setIcon(resourceMap.getIcon("sideProjButton.icon")); // NOI18N
        sideProjButton.setText(resourceMap.getString("sideProjButton.text")); // NOI18N
        sideProjButton.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder(""), resourceMap.getString("sideProjButton.border.title"), javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, resourceMap.getFont("sideProjButton.border.titleFont"))); // NOI18N
        sideProjButton.setName("sideProjButton"); // NOI18N
        sideProjButton.setPreferredSize(new java.awt.Dimension(140, 140));
        sideProjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                showSideProjects(evt);
            }
        });

        javax.swing.GroupLayout projectManagerPanelLayout = new javax.swing.GroupLayout(projectManagerPanel);
        projectManagerPanel.setLayout(projectManagerPanelLayout);
        projectManagerPanelLayout.setHorizontalGroup(
            projectManagerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(projectManagerPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(gameDevButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(21, 21, 21)
                .addComponent(sideProjButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        projectManagerPanelLayout.setVerticalGroup(
            projectManagerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(projectManagerPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(projectManagerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(gameDevButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(sideProjButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(projectManagerPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(projectManagerPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void showSideProjects(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showSideProjects

        if (Core.runningSideProject == false && Core.sideProjectFinished == true) {
            JFrame mainFrame = StartupCompanyManager2012App.getApplication().getMainFrame();
            sideProjcSelector = new StartupCompanyManager2012SideProjc();
            sideProjcSelector.setLocationRelativeTo(mainFrame);
            StartupCompanyManager2012App.getApplication().show(sideProjcSelector);
        } else {
            JFrame mainFrame = StartupCompanyManager2012App.getApplication().getMainFrame();
            sideProjcWork = new StartupCompanyManager2012SideProjcWork();
            sideProjcWork.setLocationRelativeTo(mainFrame);
            StartupCompanyManager2012App.getApplication().show(sideProjcWork);
        }
        dispose();
    }//GEN-LAST:event_showSideProjects

    private void codeGame(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_codeGame
        JFrame mainFrame = StartupCompanyManager2012App.getApplication().getMainFrame();
        gameCreator = new StartupCompanyManager2012gameCreator();
        gameCreator.setLocationRelativeTo(mainFrame);
        StartupCompanyManager2012App.getApplication().show(gameCreator);
        dispose();
    }//GEN-LAST:event_codeGame
    /**
     * @param args the command line arguments
     */
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton gameDevButton;
    private javax.swing.JPanel projectManagerPanel;
    private javax.swing.JButton sideProjButton;
    // End of variables declaration//GEN-END:variables
    private JFrame sideProjcSelector;
    private JFrame sideProjcWork;
    private JFrame gameCreator;
}
